﻿using System.Data.Entity.ModelConfiguration;
using RealtReview.DataAccess.Entities;

namespace RealtReview.DataAccess.Mappings
{
    public class AddressMap : EntityTypeConfiguration<Address>
    {
        public AddressMap()
        {
            HasMany(e => e.Apartments)
            .WithRequired(e => e.Address)
            .HasForeignKey(e => e.AdressId)
            .WillCascadeOnDelete(false);
        }
    }
}